home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 8
/
Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso
/
Aminet
/
comm
/
fido
/
MM_ScriptSet1.lha
/
MM_PGP.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-08-14
|
2KB
|
72 lines
/*
** MM_PGP.rexx v1.0 by Tomasz Nidecki
**
** This script allows you to encrypt and decrypt PGP messages
** from your Browse menu. The message you are reading can be
** encrypted or decrypted with signatures, etc.
** attn! pgp must be in your path for this to work, and its
** directory must have a PGP: assign to it. Also set the
** environment variable PGPPATH to the right path.
**
** If message is written to you, it will be decoded,
** if it is written by you, it will be encoded.
** If none of these cases is true, nothing will be done.
**
** ATTENTION! Make sure that the key you are trying to
** encode with is a certified key! If not, i've had problems with
** this script (PGP freezing and taking up memory...)
**
** Also notice that your secret password will be visible in
** the requester, so don't enter it when someone's around...
**
** Args: rx MM_PGP.rexx %a %n
*/
ADDRESS "MAILMANAGER"
PARSE ARG area_tag msg_num
MM_ReadMsg area_tag msg_num read_stem
MM_GetSysop sysop_name
IF read_stem.from = sysop_name
THEN
DO
MM_StringReq '"'Secret phrase'"' sec_phrase
ADDRESS COMMAND "setenv PGPPASS" sec_phrase
MM_WriteStem "t:mm" read_stem.text
ADDRESS COMMAND "delete >NIL: t:mm.asc"
ADDRESS COMMAND "PGP:PGP +force -esa t:mm" read_stem.to
ADDRESS COMMAND "delete >NIL: ENV:PGPPASS"
edit_stem.flags = 'SENT'
edit_stem.file = "t:mm.asc"
MM_EditMsg area_tag msg_num edit_stem
set_flags = "!SENT"
MM_EditMsgFlags area_tag msg_num 'set_flags'
ADDRESS COMMAND "delete >NIL: t:mm"
END
ELSE
IF read_stem.to = sysop_name
THEN
DO
MM_StringReq '"'Secret phrase'"' sec_phrase
ADDRESS COMMAND "setenv PGPPASS" sec_phrase
MM_WriteStem "t:mm.pgp" read_stem.text
ADDRESS COMMAND "PGP:PGP t:mm.pgp"
ADDRESS COMMAND "delete >NIL: ENV:PGPPASS"
edit_stem.flags = 'SENT'
edit_stem.file = "t:mm"
MM_EditMsg area_tag msg_num edit_stem
set_flags = "SENT"
MM_EditMsgFlags area_tag msg_num 'set_flags'
ADDRESS COMMAND "delete >NIL: t:mm"
END